<%@ page import="com.ws.utils.Res" %><%--
  Created by IntelliJ IDEA.
  User: lufei
  Date: 2025/3/22
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="${ pageContext.request.contextPath}/admin/bootstrap/css/bootstrap.min.css">
	<script src="${ pageContext.request.contextPath}/admin/bootstrap/js/jquery-2.1.0.min.js"></script>
	<script src="${ pageContext.request.contextPath}/admin/bootstrap/js/bootstrap.min.js"></script>
    <style>

       .cus-container{
           width: 1368px;
       }
       #user-add .modal-content{
       	padding: 0 20px 20px;	
       }
       #user-edit .modal-content{
       	padding: 0 20px 20px;	
       }
       
    </style>
</head>
<body>

    <div class="container cus-container">
        <!-- <h3 class="text-center">用户信息列表</h3> -->
        <div>
            <div id="search-user" style="float: left; margin: 10px 0px;">
                <form class="form-inline" action="${pageContext.request.contextPath}/homeUsers/list" method="post">
                    <div class="form-group">
                        <label for="exampleInputName2">用户名</label>
                        <input type="text" name="user_name" value="${userVo.user_name}" class="form-control" id="exampleInputName2" >
                    </div>
                    &nbsp;
                    <div class="form-group">
                        <label for="exampleInputName1">手机号</label>
                        <input type="text" name="user_phone" value="${userVo.user_phone}" class="form-control" id="exampleInputName1" >
                    </div>
                    &nbsp;
                    <div class="form-group">
                        <label for="exampleInputName">生日</label>
                        <input type="date" name="user_date" value="${userVo.user_date}" class="form-control" id="exampleInputName" >
                    </div>
                    <input type="hidden" name="pageSize" value="${userVo.pageSize}">
                    <input type="submit" class="btn btn-default" value="查询">
                </form>
            </div>
            <!-- 添加、删除的按钮 -->
            <div style="float: right;margin: 10px 0px;">
                <a class="btn btn-primary" href="${ pageContext.request.contextPath}/homeUsers/toadd">添加用户</a>
            </div>
        </div>

      
       <table class="table table-bordered clearfix" id="user-list">
        <thead>
        	<tr class="bg-primary">
	            <th>编号</th>
	            <th>用户名</th>
                <th>密码</th>
                <th>手机号</th>
                <th>生日</th>
	            <th>头像</th>
	            <th>操作</th>
	        </tr> 
        </thead> 
        <tbody>
        <c:forEach items="${pageInfo.list}" var="user">
            <tr>
                <td>${user.user_id}</td>
                <td>${user.user_name}</td>
                <td>${user.user_pass}</td>
                <td>${user.user_phone}</td>
                <td>${user.user_date}</td>
                <td>
                    <img src="<%=Res.fileUrl%>${user.user_tx}" width="50px" height="50px">
                </td>
                <td>
                    <a class="btn btn-primary btn-xs" href="${ pageContext.request.contextPath}/homeUsers/toUpdate?user_id=${user.user_id}">修改</a>
                    <a class="btn btn-danger btn-xs" href="${ pageContext.request.contextPath}/homeUsers/delete?user_id=${user.user_id}&tx=${user.user_tx}">删除</a>
                </td>
            </tr>
        </c:forEach>
         </tbody>
      </table>
        <div class="text-center">
            <ul class="pagination">
                <li><a href="${ pageContext.request.contextPath}/homeUsers/list?currentPage=1&user_name=${userVo.user_name}&user_phone=${userVo.user_phone}&user_date=${userVo.user_date}&pageSize=${userVo.pageSize}">首页</a></li>
                <li><a href="${ pageContext.request.contextPath}/homeUsers/list?currentPage=${ pageInfo.prePage}&user_name=${userVo.user_name}&user_phone=${userVo.user_phone}&user_date=${userVo.user_date}&pageSize=${userVo.pageSize}">上一页</a></li>
                <c:forEach begin="${ pageInfo.navigateFirstPage}" end="${ pageInfo.navigateLastPage}" var="page">
                    <li><a href="${ pageContext.request.contextPath}/homeUsers/list?currentPage=${ page}&user_name=${userVo.user_name}&user_phone=${userVo.user_phone}&user_date=${userVo.user_date}&pageSize=${userVo.pageSize}">${ page}</a></li>
                </c:forEach>
                <li><a href="${ pageContext.request.contextPath}/homeUsers/list?currentPage=${ pageInfo.nextPage}&user_name=${userVo.user_name}&user_phone=${userVo.user_phone}&user_date=${userVo.user_date}&pageSize=${userVo.pageSize}">下一页</a></li>
                <li><a href="${ pageContext.request.contextPath}/homeUsers/list?currentPage=${ pageInfo.pages}&user_name=${userVo.user_name}&user_phone=${userVo.user_phone}&user_date=${userVo.user_date}&pageSize=${userVo.pageSize}">末页</a></li>
                <li><a>当前第${ pageInfo.pageNum}页</a></li>
                <li><a>共${ pageInfo.pages}页</a></li>
                <li><a>共${ pageInfo.total}条记录</a></li>
                <li>
                    <a>
                        每页显示：
                        <select name="pageSize" onchange="sel(this.value)">
                            <option value="2" ${pageInfo.pageSize == 2 ? 'selected' : ''}>2</option>
                            <option value="5" ${pageInfo.pageSize == 5 ? 'selected' : ''}>5</option>
                            <option value="10" ${pageInfo.pageSize == 10 ? 'selected' : ''}>10</option>
                        </select>条
                    </a>
                </li>
            </ul>
        </div>



     </div>
</body>
</html>
<script>
    function sel(pageSize) {
        location.href = "${ pageContext.request.contextPath}/homeUsers/list?currentPage=1&pageSize="+pageSize;
    }
</script>